<template>
  <div class="about">
    {{ childName }}
    <UserDetail title="管理标题" @submit="handleSearch"></UserDetail>
  </div>
</template>
<script lang="ts">
import { defineComponent, reactive, toRefs } from "vue";
import { useRouter } from "vue-router";
import UserDetail from "./UserDetail.vue";
export default defineComponent({
  name: "userlist",
  components: {
    UserDetail,
  },
  setup(props, context) {
    const state = reactive({
      loaderTxt: "组件传值",
      childName: "默认值",
    });
    const handleClick = () => {
      console.log("123123");
    };
    const handleSearch = (val) => {
      console.log("context", val);
      state.childName = val;
    };
    return {
      ...toRefs(state),
      handleClick,
      handleSearch,
    };
  },
});
</script>